Skip to content

fix(zfile): check gzread returns for truncated or corrupt input - #5372

Merged
lgritz merged 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-zfile
Aug 14, 2026
Merged

fix(zfile): check gzread returns for truncated or corrupt input#5372
lgritz merged 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-zfile

Conversation

@lgritz

@lgritz lgritz commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

The reader ignored gzread()'s return value when reading the header and each scanline, so a truncated or corrupt (gzip) file was processed with whatever happened to be in the buffer. Verify the requested number of bytes was actually read and error out otherwise.

Also add a test for the decompression bomb checks that have already been added in a prior PR.

Assisted-by: GitHub Copilot / Claude Opus 4.8

The reader ignored gzread()'s return value when reading the header and
each scanline, so a truncated or corrupt (gzip) file was processed with
whatever happened to be in the buffer. Verify the requested number of
bytes was actually read and error out otherwise.

Also add a test for the decomression bomb checks that have already
been added in a prior PR.

Assisted-by: GitHub Copilot / Claude Opus 4.8

Signed-off-by: Larry Gritz <lg@larrygritz.com>
@lgritz

lgritz commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator Author

Straightforward small fix -- check return codes for errors that we neglected to check before.
Any comments or objections?

@lgritz
lgritz merged commit d8c4320 into AcademySoftwareFoundation:main Aug 14, 2026
30 checks passed
@lgritz
lgritz deleted the lg-zfile branch August 14, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants